# config.py
import numpy as np

rgb_mean = [127.0, 127.0, 127.0]
rgb_std = [128.0, 128.0, 128.0]

mnet_face_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    'name': 'mobilenet0.25',
    'pretrain': False,
    'return_layers': {'stage1': 1, 'stage2': 2, 'stage3': 3},
    'in_channel': 32,
    'out_channel': 64,
    'min_sizes': [[10, 20], [32, 64], [128, 256]],
    'shrinkage': [8, 16, 32],
    # 'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    # "shrinkage": [8, 16, 32, 64],
    "aspect_ratios": [[1.0, 1.0]],
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'clip': False,
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": ['BACKGROUND', 'face'],
}

rfb_face_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    "aspect_ratios": [[1.0, 1.0]],
    "shrinkage": [8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": ['BACKGROUND', 'face'],
    'clip': False,
}

face_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    "aspect_ratios": [[1.0, 1.0]],
    "shrinkage": [8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": ['BACKGROUND', 'face'],
    'clip': False,
}

face_person_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0]],
    "shrinkage": [8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": ['BACKGROUND', 'face', 'person'],
    'clip': False,
}

face_person_lie_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    "min_sizes": [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],  # for Face and person
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.5, 1.2], [1.0, 2.0], [2.0, 1.0]],
    "shrinkage": [8, 16, 32, 64],
    "class_names": ['BACKGROUND', 'face', 'person', "hand"],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    'clip': False,
}

face_person_yolox_config = {
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0]],
    "shrinkage": [8, 16, 32],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": ['BACKGROUND', 'face', 'person'],
    'clip': False,
}

card_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[16], [32, 48], [64, 96], [128, 192, 256]],
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0], [1.5, 1.2], [2.0, 1.0]],
    "shrinkage": [8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": {'BACKGROUND': 0, 'card': 1, '1': 1},
    'clip': False,
}

card_yolox_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16], [24, 32, 48], [64, 96, 128]],
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0], [1.5, 1.2], [2.0, 1.0]],
    "shrinkage": [8, 16, 32],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": {'BACKGROUND': 0, 'card': 1, '1': 1},
    'clip': False,
}

yolox_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    'min_sizes': [[10, 16], [24, 32, 48], [64, 96, 128]],  # min_sizes0
    # "min_sizes": [[10, 16], [24, 32], [48, 64, 96], [128, 192, 256]],  # min_sizes1
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0], [1.5, 1.2], [2.0, 1.0]],
    "shrinkage": [8, 16, 32],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": None,
    'clip': False,
}

default3s_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    # "min_sizes": [[10], [16, 24], [32, 48, 64, 96], [128, 192, 256]],
    'min_sizes': [[10, 16], [24, 32, 48], [64, 96, 128]],  # min_sizes5
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.0, 2.0], [1.5, 1.2], [2.0, 1.0]],
    "shrinkage": [8, 16, 32],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": None,
    'clip': False,
}

default_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    # "min_sizes": [[10, 16, 24], [32, 48], [64, 96], [128, 192, 256]],  # min_sizes0
    # "min_sizes": [[10, 16], [24, 32, 48], [64, 96], [128, 192, 256]],  # min_sizes1
    # "min_sizes": [[10, 16], [24, 32, 48, 64], [64, 96], [128, 192, 256]],  # min_sizes2
    "min_sizes": [[10, 16], [24, 32], [48, 64, 96], [128, 192, 256]],  # min_sizes3(效果最好)
    # "min_sizes": [[10], [16, 24, 32], [48, 64, 96], [128, 192, 256]],  # min_sizes4
    # "min_sizes": [[10], [16, 24], [32, 48, 64, 96], [128, 192, 256]],  # min_sizes5
    "aspect_ratios": [[1.0, 1.0], [1.2, 1.5], [1.5, 1.2], [1.0, 2.0], [2.0, 1.0]],
    "shrinkage": [8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": None,
    'clip': False,
}

default4s_config = default_config

retails_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    "min_sizes": [[8], [16, 24], [32, 48], [64], [96]],  # min_sizes0
    # "min_sizes": [[8], [16, 24, 32], [40, 48], [64], [96]], # min_sizes1
    # "min_sizes": [[8], [16, 24, 32], [40, 48, 56], [64], [96]],  # min_sizes2
    "aspect_ratios": [[1.0, 1.0], [1.0, 2.0], [2.0, 1.0]],
    "shrinkage": [4, 8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": None,
    'clip': False,
}

demo_config = {
    "rgb_mean": rgb_mean,
    "rgb_std": rgb_std,
    "iou_threshold": 0.3,
    "center_variance": 0.1,
    "size_variance": 0.2,
    "min_sizes": [[8], [16, 24, 32], [40, 48], [64], [96]],
    "aspect_ratios": [[1.0, 1.0], [1.0, 2.0], [2.0, 1.0]],
    "shrinkage": [4, 8, 16, 32, 64],
    'loc_weight': 2.0,
    'landm_weight': 1.0,
    "class_name": None,
    'clip': False,
}
